// 消息弹出框
export function MessageNotify() {
  return {
    success: function(obj, message) {
      obj.$notify.success({ position: 'bottom-right', title: '成功', message: message, duration: 2000 })
    },
    warn: function(obj, message) {
      obj.$notify.warning({ position: 'bottom-right', title: '警告', message: message })
    },
    info: function(obj, message) {
      obj.$notify.info({ position: 'bottom-right', title: '消息', message: message, duration: 2000 })
    },
    error: function(obj, message) {
      obj.$notify.error({ position: 'bottom-right', title: '错误', message: message })
    }
  }
}

// 消息提示框
export function MessageAlert() {
  return {
    success: function(obj, message) {
      obj.$message({ type: 'success', message: message })
    },
    warn: function(obj, message) {
      obj.$message({ type: 'warning', message: message })
    },
    info: function(obj, message) {
      obj.$message({ message: message })
    },
    error: function(obj, message) {
      obj.$message({ type: 'error', message: message })
    }
  }
}
export const Notify = new MessageNotify()
export const Alert = new MessageAlert()
export default Notify
